﻿

namespace RedisMailTool
{
    using System.Collections.Generic;

    using Abp.Configuration;
    using Abp.Modules;
    using Abp.Net.Mail;

    public class SendMailModule : AbpModule
    {
        public override void PreInitialize()
        {
                        this.Configuration.Settings.Providers.Add<AppSettingProvider>();
        }

        public override void Initialize()
        {
        }

        public override void PostInitialize()
        {
        }
    }

    public class AppSettingProvider : SettingProvider
    {
        /// <summary>
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
        {
            return new[]
                       {
                           new SettingDefinition(EmailSettingNames.Smtp.EnableSsl, "true"),
                           new SettingDefinition(EmailSettingNames.Smtp.UseDefaultCredentials, "false"),
                           new SettingDefinition(EmailSettingNames.Smtp.UserName, "smtp服务器账号"),
                           new SettingDefinition(EmailSettingNames.Smtp.Password, "smtp服务器密码"),
                           new SettingDefinition(EmailSettingNames.Smtp.Host, "smtp.qq.com(smtp服务器地址)"),
                           new SettingDefinition(EmailSettingNames.Smtp.Port, "25(smtp服务器端口)"),
                           new SettingDefinition(EmailSettingNames.DefaultFromAddress, "发送者邮箱(必填)"),
                           new SettingDefinition(EmailSettingNames.DefaultFromDisplayName, "发送者显示名称")
                       };
        }
    }

}